package main

import (
	"bufio"
	"fmt"
	"net"
	"os"
)

// 网络
func main() {
	fmt.Println("客户端启动")
	conn, err := net.Dial("tcp", "127.0.0.1:8080")
	if err != nil {
		fmt.Println("连接失败", err)
		return
	}

	fmt.Println("连接成功")
	reader := bufio.NewReader(os.Stdin)
	str, _ := reader.ReadString('\n')

	conn.Write([]byte(str))

}
